# -*- coding: utf-8 -*-
from liberHook.BaseHook import BaseHook
from liberLibs.dccLibs import Maya


class Hook(BaseHook):
    def __init__(self, library, directory, ext, start, end):
        BaseHook.__init__(self, library, directory, ext, start, end)

    def execute(self):
        if not Maya.load_plugin("AbcExport.mll"):
            self.append_error("Load AbcExport.mll failed.")
            return
        self.remove_location()
        file_path = self.file
        sel = Maya.selected()
        Maya.export_abc(self.start, self.end, file_path, sel)
